package ru.study.thinkin.chapter14;

import java.util.*;

public class NoCovariantGenerics {

	
	public static void main(String[] args) {
		//List <Fruit> flist3 = new ArrayList<Apple>();//будет ошибка
		List<? extends Fruit> flist2 = new ArrayList<Apple>();
		
		List<? extends Fruit> flist = Arrays.asList(new Apple());
		Apple a  = (Apple) flist.get(0);
		
		flist.contains(new Apple());
		flist.indexOf(new Apple());
		
		//flist.add(new Fruit()); // не сработает
		

	}

}
